package com.sml.util;

import com.sml.util.entity.Message;
import com.sml.util.entity.Text;
import org.springframework.http.ResponseEntity;

/**
 * @Author linlx
 * @Date 2021/9/7 9:23
 * @Description
 **/
public class DingDingRobotUtil {

  public static String sendMessage(String url, String content) {
    Message message = new Message();
    message.setMsgtype("text");
    Text text = new Text();
    text.setContent(content);
    message.setText(text);
    ResponseEntity<String> responseEntity = RestTemplateFactory
        .postForEntity(url, null, message, String.class);
    return responseEntity.getBody();
  }

}
